package com.example.springboot.dao;

import com.example.springboot.pojo.User;
import org.apache.ibatis.annotations.*;
import java.util.ArrayList;

@Mapper
public interface UserMapper
{
    public void Save(User user);
    @Insert("insert into user values(#{id},#{name},#{sex},#{age},#{password})")
    public void Save1(User user);
    public User getById(@Param("id") String id);
    @Select("select * from user where id=#{id}")
    public User getById2(String id);
    public ArrayList<User> getAll();
    public ArrayList<User> getAll1();
    public ArrayList<User> getAll2();
    void deleteById(@Param("id") Integer id);
    @Delete("delete from user where id=#{id}")
    void deleteById2(String id);
    void updateAge(@Param("id") String id,@Param("age") Integer age);
    @Update("update user set age=#{age} where id=#{id}")
    void updateAge2(String id,Integer age);
    Integer login(@Param("id") String id,@Param("password") String password);
    public ArrayList<User> queryUser(@Param("startNum") Integer startNum,@Param("pageSize") Integer pageSize);
}
